import time

from config import BASE_URL
from page.page_login import LoginPage
from page.page_loan import LoanPage
from tools import DriverTools


class TestLoan(object):
    def setup_method(self):
        driver = DriverTools.get_driver()
        driver.get(BASE_URL + "/common/member/login#?type=1")
        self.back_login = LoginPage(driver)
        self.loan = LoanPage(driver)

    def teardown_method(self):
        DriverTools.quit_driver()

    def test01_loan_success(self):
        self.back_login.login("18683060005", "abc123")
        self.loan.personal_loan()
        self.loan.apply_submit()
        time.sleep(1)
        self.loan.get_shot("loan_success.png")
